# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-exceptiongroup
pkgver=1.0.0_rc8
_pkgver=${pkgver/_/}
pkgrel=0
pkgdesc="Backport of PEP 654 (exception groups)"
url="https://github.com/agronholm/exceptiongroup"
license="MIT"
arch="noarch"
depends="python3"
makedepends="py3-build py3-flit-core py3-installer py3-wheel"
checkdepends="py3-pytest"
source="https://github.com/agronholm/exceptiongroup/archive/$_pkgver/py3-exceptiongroup-$pkgver.tar.gz
	use-flit-core.patch
	"
builddir="$srcdir/exceptiongroup-$_pkgver"

prepare() {
	default_prepare

	sed -i "s/%VERSION%/$_pkgver/" src/exceptiongroup/__init__.py
}

build() {
	python3 -m build --no-isolation --wheel
}

check() {
	PYTHONPATH=src pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/exceptiongroup-$_pkgver-py3-none-any.whl
}

sha512sums="
f7f1700403f345755a1e32c77eb43744b366b1f55446e1898dd960988d23396ad8334bef072ecc7ec5ac7075300f0f3e8e9a0d454d9dd80677ae55b4166fc6e4  py3-exceptiongroup-1.0.0_rc8.tar.gz
0b52b660790138e33d0641910197b2257f859ac0f24f5f99e717362f5266793a97703afad3dc51673bc021c31dae21342857c9d10d713a028be4870c12761869  use-flit-core.patch
"
